﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LenderClearingHouse
{
  public partial class Maint : PageBase
  {
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnUpdateAssmts_Click(object sender, EventArgs e)
    {
      try
      {
        string[] apns = ImportDataAccess.getApnLVREOMasterlist();
        foreach (string apn in apns)
        {
          ImportDataAccess.UpdateLvReoAssmts(apn);
        }

        ScriptManager.RegisterStartupScript(this, this.GetType(),
          "key",
          string.Format("alert('There are {0} properties updated');", apns.Length), true);
      }
      catch (Exception ex)
      {
        ScriptManager.RegisterStartupScript(this, this.GetType(),
          "key",
          string.Format("alert('An Error Occured');", ex.Message), true);
      }
    }
  }
}